package com.tester.yaa.exam001.agent;

/**
 * @Aduthor yinanan
 * @ClassName Student
 * @Date 2022/12/4 16:34
 * @Description TODO
 **/
public class Student implements Person {
    
    /** 
    * @Description: //普通实现
    * @author: yinanan
    * @Param: [message]
    * @return: java.lang.String  
    * @Date: 2022/12/4
    */ 
    @Override
    public String say(String message) {
        return message;
    }
    
    /** 
    * @Description: //执行接口
    * @author: yinanan
    * @Param: [args]
    * @return: void  
    * @Date: 2022/12/4
    */ 
    public static void main(String[] args) {
        //普通的实现调用
        Student stu = new Student();
        System.out.println(stu.say("这里是实现接口后的返回......."));

        //静态代理调用
        Person target = new Student();
        PersonAgent proxy = new PersonAgent(target);
        System.out.println(proxy.say("这里是采用静态代理实现接口后的返回......."));

        //动态代理调用
        Person proxy2 = (Person) new PersonAgent(target).getProxyInstance("这里是采用动态代理实现接口后的返回.......");
        System.out.println(proxy2.say(null));
    }
}
